package com.work.framework.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Objects;

/**
 * 用户表
 */

@TableName("user")
public class User implements Serializable {



  @TableId(type= IdType.AUTO)
  private Integer uid;            //用户编号（主键）
  private String account;        //账号
  private String pwd;             //密码
  private Integer rId;            //角色编号（角色表主键）
  private Integer status;         //账号状态（0.冻结 1.正常）

  public Integer getStatus() {
    return status;
  }

  public void setStatus(Integer status) {
    this.status = status;
  }

  public Integer getUid() {
    return uid;
  }

  public void setUid(Integer uid) {
    this.uid = uid;
  }

  public String getAccount() {
    return account;
  }

  public void setAccount(String account) {
    this.account = account;
  }

  public String getPwd() {
    return pwd;
  }

  public void setPwd(String pwd) {
    this.pwd = pwd;
  }


  public Integer getRId() {
    return rId;
  }

  public void setRId(Integer rId) {
    this.rId = rId;
  }

  @Override
  public String toString() {
    return "User{" +
            "uid=" + uid +
            ", account='" + account + '\'' +
            ", pwd='" + pwd + '\'' +
            ", rId=" + rId +
            ", status=" + status +
            '}';
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof User)) return false;
    User user = (User) o;
    return Objects.equals(uid, user.uid) &&
            Objects.equals(account, user.account) &&
            Objects.equals(pwd, user.pwd) &&
            Objects.equals(rId, user.rId) &&
            Objects.equals(status, user.status);
  }

  @Override
  public int hashCode() {
    return Objects.hash(uid, account, pwd, rId, status);
  }
}
